﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;

namespace Inaction.Linq.Clause
{
    abstract class ValueClause : WhereClause
    {
        public override bool IsValue
        {
            get
            {
                return true;
            }
        }

        public ValueClause(LinqRoot root, object value = null, Expression e = null)
            : base(root, e)
        {
            if (value != null)
            {
                ParaValue = root.AddPara(value);
            }
        }

        public override string GetClauseSql()
        {
            return ParaValue.Name;
        }

        public override string ToString()
        {
            return ParaValue.Value.ToString();
        }
    }
}
